<template>
  <div class="spaceWrapper">
    <ul>
      <li @click="listItemClick(item, index)" v-for="(item, index) in 16" :key="index">
        <img
          class="image"
          :src="require('~/assets/images/background.jpg')"
          alt
          width="100"
          height="100"
        />
        <div class="followContent">
          <div class="userProfile">
            <span>人生已经所剩无几，一人，一狗，一爱人，从此闯荡天涯</span>
          </div>
          <div class="followingAndFollower">
            <span class="follower">
              <em>120K</em>Members
            </span>
          </div>
        </div>
        <div class="btn">
          <el-button size="mini" round @click.stop.prevent="join(item, index)">加入社区</el-button>
        </div>
      </li>
    </ul>
  </div>
</template>

<script lang="ts">
import { Component } from 'nuxt-property-decorator'
import { BaseVue } from '@/plugins/base-vue'
@Component({
  layout: 'space',
})
export default class Community extends BaseVue {
  listItemClick(item: any, index: number) {
    this.$router.push(`/space/community/${index}`)
  }

  join(item: any, index: number) {}
}
</script>

<style lang="scss" scoped>
.spaceWrapper {
  width: 62.5%;
  margin: 100px auto;
  padding: 24px;

  ul {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;

    li {
      transition: all 0.5s;
      &:hover {
        transform: scale(1.1, 1.1);
      }
      cursor: pointer;
      &:nth-child(5n) {
        margin-right: 0;
      }
      margin-bottom: 20px;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-flow: row wrap;
      background-color: #24292e;
      padding: 10px;
      box-sizing: border-box;
      height: 270px;
      width: 215px;
      border-radius: 10px;

      .image {
        border-radius: 50%;
      }

      .followContent {
        display: flex;
        justify-content: center;
        flex-flow: row wrap;

        .userProfile {
          width: 160px;
          padding-bottom: 10px;
        }

        .followingAndFollower {
          display: flex;
          justify-content: center;

          .follower {
            margin-right: 10px;

            em {
              color: #ffff;
              padding-right: 10px;
            }
          }

          .following {
            em {
              color: #ffff;
              padding-right: 10px;
            }
          }
        }
      }
    }
  }

  ::v-deep .el-button {
    background-color: #03e9f4;
    border: 1px solid #03e9f4;
    color: #ffff;
  }
}
</style>
